// console.log(data_fuzhou);
var Allproblem_fz=0,Allpunish_fz=0,Allother_fz=0;
var data_fz_html='',data_fz_county='';
$.each(data_fuzhou, function (i, n) { 
    Allproblem_fz+=Number(n.problem);
    Allpunish_fz+=Number(n.punish);
    Allother_fz+=Number(n.other);
    data_fz_county+='<p class="data_fz_data"><span>'+n.county+'</span>'+
                    '<span>'+n.problem+'</span>'+
                    '<span>'+n.punish+'</span>'+
                    '<span>'+n.other+'</span></p>';
});
data_fz_html+='<p class="data_fz_data"><span>福州市</span>'+
                '<span>'+Allproblem_fz+'</span>'+
                '<span>'+Allpunish_fz+'</span>'+
                '<span>'+Allother_fz+'</span></p>'+
                '<div class="data_fz_Allcounty">'+
                '<div class="data_fz_county">'+data_fz_county+'<p class="data_fz_data"></p>'+data_fz_county+'</div>'+
                // '<div class="data_fz_county">'+data_fz_county+'</div>'+
                '</div>';
$('.data_fz_header').after(data_fz_html);
setTimeout(function(){
    // $(function () {  
        $("#select_county").select2();  
        $('#select_proselect').select2();
        $("#select_county,#select_proselect").select2({
            language: {
                 noResults: function (params) {
                 return "暂无数据";
             }
         }
        })
    // }); 
},1500)

var setBtn;
$('.chartName,.map_1_SET').on({
    mouseover:function(){
        $('.map_1_SET').show();
    },
    mouseout:function (){
        if(setBtn == true){
            return;
        }
        $('.map_1_SET').hide();
    }
}) 
//设置
var colorArrey=[];
colorArrey.push(
    [],
    ['#fb497b','#fec760','#70e522','#4ecbff','#4d7bf4','#214e9f','#6f21d9'],
    ["#ff3D02",'#FE5508','#FE7714','#ff961f','#ffb92b','#ffda36','#fff440'],
    ['#1565c0','#1976d2','#1e88e5','#2196f3','#42a5f5','#64b5f6','#90caf9'],
    ['#febbdd','#fa81cc','#c56daf','#8d3b69','#20598f','#e15172','#fab37e'],
    ['#eedbc8','#ee5572','#3a2e4e','#7d3a46','#a2657e','#d5ad88'],
    ['#ecd2bd','#f49587','#e64f49','#7b4d51','#67939b','#acb192'],
    ['#f9c8c4','#ff9e96','#d4595b','#f28469','#e5b966','#f9d089'],
    ['#32899d','#915e35', '#81303c','#37e5c9', '#4e895e', '#938b2a']
)
var colorNow=1;
// console.log(colorNow);
// console.log(colorArrey[colorNow]);
$('.map_1_SET').click(function(){
    setBtn=true;
    // console.log(setline)
    $('.setInterface').css('display','block');
    $('.nowNum').val(setline);
    $('.nowSize_1').val(setSize_leftTop);
    $('.nowSize_2').val(setSize_leftCenter);
    $('.nowSize_3').val(setSize_leftBottom);
    $('.nowTop').val(setTop);
    $('.hoverSize').val(hoverSize);
    $('.symSize').val(symbolAll);
    $('.yAxisSize').val(yAxisSize);
    $('.yAxisSizeLast').val(yAxisSizeLast);
    $('.mapColor').val(colorNow);
})
$('.setInterface button').click(function(){
    setBtn=false
    setline=$('.nowNum').val();
    setSize_leftTop=$('.nowSize_1').val();
    setSize_leftCenter=$('.nowSize_2').val();
    setSize_leftBottom=$('.nowSize_3').val();
    setTop=$('.nowTop').val();
    hoverSize=$('.hoverSize').val();
    symbolAll=$('.symSize').val();
    yAxisSize=$('.yAxisSize').val();
    yAxisSizeLast=$('.yAxisSizeLast').val();
    colorNow=$('.mapColor').val();
    // console.log(setline);
    startLeftTop(); 
    startLeftCenter();
    startLeftBottom();
    // console.log($('.countyName').text());
    if($('.countyName').text() !='全市'){
        data_Proclick=JSON.stringify({"project":$('.countyName').text()});
        dataMap(data_Proclick);
    }else{
        startMapdata();
    }
    $('.setInterface').hide();
})